import request from '@/utils/request.js';

export const loginApi = (data) => {
    return request({
        url: '/users/checkLogin',
        method: 'post',
        data
    })
}
export const accaddApi = (data) => {
    return request({
        url: '/users/repeat',
        method: 'post',
        data
    })
}
export const accApi = (data) => {
    return request({
        url: '/users/add',
        method: 'post',
        data
    })
}
export const ModApi = (data) => {
    return request({
        url: '/users/checkoldpwd',
        method: 'get',
        params: data
    })
}
export const accmodApi = (data) => {
    return request({
        url: '/users/editpwd',
        method: 'post',
        data
    })
}

export const listApi = (params) => {
    return request({
        url: '/users/list',
        method: 'get',
        params
    })
}
export const delApi = (params) => {
    return request({
        url: '/users/del',
        method: 'get',
        params
    })
}
export const delsApi = (data) => {
    return request({
        url: '/users/batchdel',
        method: 'post',
        data
    })
}
export const editApi = (data) => {
    return request({
        url: '/users/edit',
        method: 'post',
        data
    })
}
export const myApi = (params) => {
    return request({
        url: '/users/info',
        method: 'get',
        params
    })
}

export const uploadApi = (data) => {
    return request({
        url: '/users/avatar_upload',
        method: 'post',
        data
    })
}

export const avatApi = (params) => {
    return request({
        url: '/users/avataredit',
        method: 'get',
        params
    })
}